<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
	<h:head>
		<title>My Facelets Page</title>
		<meta http-equiv="keywords" content="enter,your,keywords,here" />
		<meta http-equiv="description"
			content="A short description of this page." />
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		
		<script type="text/javascript">
		<!--
			function test(){
				alert('出错了');
			}
			//!-->
		</script>
		<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
	</h:head>
	<h:body>
		<p>
			<ui:insert name="body">
			<h:form>
					<h:inputText value="#{ajax.ajaxMsg}">
						<f:ajax execute="@this" event="blur" listener="#{ajax.ajaxEvent}" render="@all"/>
					</h:inputText>
					<h:inputText value="#{ajax.ajaxMsg}"></h:inputText>
					
					<br/>
					<br/>
					<br/>
					
				托运方 <h:selectOneMenu value="#{ajax.user.userName}">
						<f:ajax execute="@this" event="change" listener="#{ajax.selectEvent}" render="@form" onerror="test"/>
						<f:selectItem itemLabel="张三" itemValue="zhangsan"/>
						<f:selectItem itemLabel="李四" itemValue="lisi"/>
						<f:selectItem itemLabel="王五" itemValue="wangwu"/>
					</h:selectOneMenu>	
				密码:<h:inputText value="#{ajax.user.password}"/>
				电话:<h:inputText value="#{ajax.user.tel}"/>
				地址:<h:inputText value="#{ajax.user.address}"/>
					
			</h:form>
			<br/>
			<br/>
			<br/>
			<br/>
			<h:inputText value="#{ajax.ajaxMsg}"></h:inputText>
			</ui:insert>
		</p>
	</h:body>
</html>


